<?php

namespace app\validate\api\recovery;

use think\Validate;

class authentValidate extends Validate
{

    protected $regex = ['phone' => '/^1[3456789]\d{9}|([0-9]{3,4}-)?[0-9]{7,8}$/'];

    protected $rule = [
        'Identity_type' => 'require',
        'phone' => 'require|regex:phone',
        'name' => 'require',
        'Identity_id' => 'require|/^\d{17}[\dX]$/',
        'identity_positive' => 'require',
        'identity_reverse' => 'require',
    ];

    protected $message = [
        'real_name.require' => '名称必须填写',
        'real_name.max' => '名称最多不能超过25个字符',
        'phone.require' => '手机号必须填写',
        'phone.regex' => '手机号格式错误',
        'province.require' => '省必须填写',
        'Identity_id.require' => '身份证号不正确',
        'identity_positive.require' => '身份证正面必填',
        'identity_reverse.require' => '身份证反面必填',
    ];

}